package org.itboys.mobile.entity.mysql.order;


import org.itboys.commons.utils.time.TimeUtils;
import org.itboys.mongodb.entity.BaseMySqlEntity;


import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 作者：jiangxiong
 * 日期：2016年11月25日
 * 联系方式 ：empty90911@126.com
 * 描述：圣代_订单_商品_实体
 */
public class SundayOrder extends BaseMySqlEntity {
     //基础信息
    private String orderNo;//订单编号
    private String title;//订单标题，商品名称截图
    private Integer type;//订单类型。
    private BigDecimal totalAmount;//订单金额应付
    private BigDecimal payAmount;//订单金额实付
    private Integer payType;//付款方式,1支付宝，2微信，
    private Integer payFrontType;//付款前端，1微信，2支付宝。
    private String payNo;//付款流水号
    private String refundNo;//退款编号（内部）
    private BigDecimal refundAmount;//退款金额
    private Integer status;//订单状态
    private Long memberId;//购买人Id;
    private String memberName;//购买人昵称
    private String memberIdCard;//身份证号
    private String memberRealName;//真实姓名
    //订单归属门店信息
    private Long shopId;//门店ID。自营为0
    private String shopName;//门店名称
    //收货人信息
    private String  receiveName;//收货人
    private String receiveMobile;//收货电话
    private Long provinceId;//省ID
    private String provinceName;//省名称
    private Long cityId;//市Id
    private String cityName;//市名称
    private Long districtId;//区ID
    private String districtName;//区名称
    private String receiveAddress;//收货地址
    //订单备注
    private String remark;//订单备注
    private String info;//订单说明
    //运费
    private BigDecimal sendAmount;//配送费

   // 折扣
    private BigDecimal discount;//折扣
    //爱购币
    private BigDecimal aiGouUsedCoin;//用户本次结算使用的爱购币。按用户等级来。
    private BigDecimal aiGouUsedAmount;// 用户本次结算使用的爱购币对应的金额。
    //优惠券
    private Long couponId;//优惠券ID
    private BigDecimal couponAmount;//优惠券优惠金额
    //余额
    private BigDecimal balanceUsedAmount;//使用的余额
    private BigDecimal conchUsedAmount;//使用的贝壳
    //商品类型特殊相关
    //拼团
    private Long teamGroupId;//拼团组ID
    private Long teamGroupMemberId;//生成拼团用户信息ID，回掉时使用
    private Integer  teamIsJoin;// //0单独购买，1参与别人的，2自己开团
    //运单信息
    private String sendCompany;//快递公司
    private String sendCompanyCode;//快递公司编号
    private String sendCode;//运单编号

    //时间信息
    private Date payTime;//付款时间
    private Date sendTime;//发货时间
    private Date receiveTime;//收货时间

    //售后信息
    private String afterRemark;//原因
    private String afterSendCompany;//快递公司
    private String afterSendCode;//运单编号


    //特殊属性。有一些只能立即购买的商品。如拼团，直接在订单里面保存商品ID
    private Long productId;//产品ID
    //2018年2月9日增加
    String excelUrl;  //excel下载订单，半链接
    //2018年2月14日
    private Integer sendType;//配送方式 1，门店配送，2自提

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Integer getPayFrontType() {
        return payFrontType;
    }

    public void setPayFrontType(Integer payFrontType) {
        this.payFrontType = payFrontType;
    }

    public String getPayNo() {
        return payNo;
    }

    public void setPayNo(String payNo) {
        this.payNo = payNo;
    }

    public String getRefundNo() {
        return refundNo;
    }

    public void setRefundNo(String refundNo) {
        this.refundNo = refundNo;
    }

    public BigDecimal getRefundAmount() {
        return refundAmount;
    }

    public void setRefundAmount(BigDecimal refundAmount) {
        this.refundAmount = refundAmount;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public String getMemberIdCard() {
        return memberIdCard;
    }

    public void setMemberIdCard(String memberIdCard) {
        this.memberIdCard = memberIdCard;
    }

    public String getMemberRealName() {
        return memberRealName;
    }

    public void setMemberRealName(String memberRealName) {
        this.memberRealName = memberRealName;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getReceiveName() {
        return receiveName;
    }

    public void setReceiveName(String receiveName) {
        this.receiveName = receiveName;
    }

    public String getReceiveMobile() {
        return receiveMobile;
    }

    public void setReceiveMobile(String receiveMobile) {
        this.receiveMobile = receiveMobile;
    }

    public Long getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(Long provinceId) {
        this.provinceId = provinceId;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public Long getCityId() {
        return cityId;
    }

    public void setCityId(Long cityId) {
        this.cityId = cityId;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public Long getDistrictId() {
        return districtId;
    }

    public void setDistrictId(Long districtId) {
        this.districtId = districtId;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public String getReceiveAddress() {
        return receiveAddress;
    }

    public void setReceiveAddress(String receiveAddress) {
        this.receiveAddress = receiveAddress;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public BigDecimal getSendAmount() {
        return sendAmount;
    }

    public void setSendAmount(BigDecimal sendAmount) {
        this.sendAmount = sendAmount;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    public BigDecimal getAiGouUsedCoin() {
        return aiGouUsedCoin;
    }

    public void setAiGouUsedCoin(BigDecimal aiGouUsedCoin) {
        this.aiGouUsedCoin = aiGouUsedCoin;
    }

    public BigDecimal getAiGouUsedAmount() {
        return aiGouUsedAmount;
    }

    public void setAiGouUsedAmount(BigDecimal aiGouUsedAmount) {
        this.aiGouUsedAmount = aiGouUsedAmount;
    }

    public Long getCouponId() {
        return couponId;
    }

    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }

    public BigDecimal getCouponAmount() {
        return couponAmount;
    }

    public void setCouponAmount(BigDecimal couponAmount) {
        this.couponAmount = couponAmount;
    }

    public BigDecimal getBalanceUsedAmount() {
        return balanceUsedAmount;
    }

    public void setBalanceUsedAmount(BigDecimal balanceUsedAmount) {
        this.balanceUsedAmount = balanceUsedAmount;
    }

    public BigDecimal getConchUsedAmount() {
        return conchUsedAmount;
    }

    public void setConchUsedAmount(BigDecimal conchUsedAmount) {
        this.conchUsedAmount = conchUsedAmount;
    }

    public Long getTeamGroupId() {
        return teamGroupId;
    }

    public void setTeamGroupId(Long teamGroupId) {
        this.teamGroupId = teamGroupId;
    }

    public Long getTeamGroupMemberId() {
        return teamGroupMemberId;
    }

    public void setTeamGroupMemberId(Long teamGroupMemberId) {
        this.teamGroupMemberId = teamGroupMemberId;
    }

    public Integer getTeamIsJoin() {
        return teamIsJoin;
    }

    public void setTeamIsJoin(Integer teamIsJoin) {
        this.teamIsJoin = teamIsJoin;
    }

    public String getSendCompany() {
        return sendCompany;
    }

    public void setSendCompany(String sendCompany) {
        this.sendCompany = sendCompany;
    }

    public String getSendCompanyCode() {
        return sendCompanyCode;
    }

    public void setSendCompanyCode(String sendCompanyCode) {
        this.sendCompanyCode = sendCompanyCode;
    }

    public String getSendCode() {
        return sendCode;
    }

    public void setSendCode(String sendCode) {
        this.sendCode = sendCode;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public Date getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Date receiveTime) {
        this.receiveTime = receiveTime;
    }

    public String getAfterRemark() {
        return afterRemark;
    }

    public void setAfterRemark(String afterRemark) {
        this.afterRemark = afterRemark;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getAfterSendCompany() {
        return afterSendCompany;
    }

    public void setAfterSendCompany(String afterSendCompany) {
        this.afterSendCompany = afterSendCompany;
    }

    public String getAfterSendCode() {
        return afterSendCode;
    }

    public void setAfterSendCode(String afterSendCode) {
        this.afterSendCode = afterSendCode;
    }

    public String getPayTimeStr(){
        if(payTime!=null)return TimeUtils.formatToTime(payTime);
        return null;
    }
    public String getSendTimeStr(){
        if(sendTime!=null)return TimeUtils.formatToTime(sendTime);
        return null;
    }
    public String getReceiveTimeStr(){
        if(receiveTime!=null)return TimeUtils.formatToTime(receiveTime);
        return null;
    }

    public Integer getSendType() {
        return sendType;
    }

    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }

    public String getExcelUrl() {
        return excelUrl;
    }

    public void setExcelUrl(String excelUrl) {
        this.excelUrl = excelUrl;
    }

    public String  getStatusStr(){
        String statusStr= "";
        if(status==null)return statusStr;

        switch (status) {
            case 1:
                statusStr="待付款";
                break;
            case 2:
                statusStr="待发货";
                break;
            case 3:
                statusStr="配送中";
                break;
            case 4:
                statusStr="待评价";
                break;
            case 5:
                statusStr="已评价";
                break;
            case 6:
                statusStr="待退款";
                break;
            case 7:
                statusStr="已退款";
                break;
            case 8:
                statusStr="待退货";
                break;
            case 9:
                statusStr="已退货";
                break;
            case 10:
                statusStr="已取消";
                break;
            case 11:
                statusStr="待拼团";
                break;
            default:
                break;
        }
        return statusStr;
    }
    public String  getTypeStr() {
        String typeStr = "";
        if (type == null) return typeStr;

        switch (type) {
            case 1:
                typeStr = "普通";
                break;
            case 2:
                typeStr = "新品";
                break;
            case 3:
                typeStr = "特卖";
                break;
            case 4:
                typeStr = "全球购";
                break;
            case 5:
                typeStr = "分销";
                break;
            case 6:
                typeStr = "爱购币";
                break;
            case 7:
                typeStr = "积分";
                break;
            case 8:
                typeStr = "秒杀";
                break;
            case 9:
                typeStr = "拼团";
                break;
            case 10:
                typeStr = "试用";
                break;
            default:
                break;
        }
        return typeStr;
    }
    public String  getSendTypeStr() {
        String sendTypeStr = "";
        if (sendType == null) return sendTypeStr;
        switch (sendType) {
            case 1:
                sendTypeStr = "门店配送";
                break;
            case 2:
                sendTypeStr = "自提";
                break;
        }
        return sendTypeStr;
    }
}


